-
-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Cake for build and overhaul/cleanup build #1589
Conversation
I can only talk about the reasoning in this PR since code isn't really my forté and henceforth I cannot discuss the potential coding issues that might/might not arise down the line. The reasoning does seem on point to me. Lowering the barrier to entry for contributing to all parts of CKAN should be something of a prime directive for us and would work in the best interest of our users since it means more contributors and thereby more fresh ideas and added features. As a Windows user I've also long envied how easy it seems to build the expected .exe files in a POSIX environment and would love the same ease in my own preferred OS. |
72025bb
to
d738cd5
Compare
If the goal is to easily build CKAN on Windows, I have a PR #1652 which uses Docker to build and run CKAN. Docker has made great strides in usability on Windows and Mac -- https://docs.docker.com/engine/installation/windows/ shows how it's done. The Docker Compose file that I use to actually run CKAN would need tweaking for Windows but all you need to do is use the location of your target KSP installation in place of the Linux default which is in that file! |
Ok, so this renames the existing "build.sh" used by Gnu make to "build", and adds the build.ps1 script used to kick off cake on Windows, but for starting cake on Llinux/MacOS, there should be a build.sh (or some renamed version). |
Microsoft now ships a version of GNU Make for Visual Studio as part of an optional package. We could utilize that to unify the build scripts, and use a tiny shim so that Microsoft's standard make tools hand off the job to GNU Make. We might want to (mostly just for fun) see if Mono or Visual Studio .Net do a better job with the build process for official binary. However, we should probably chose whichever one builds with fewer bugs. |
5ff097a
to
58f75df
Compare
I am almost done with a patch for the Dockerfile. @dbent would you prefer I give you the new lines here or would you rather a PR against your fork? EDIT: there are essentially two changes -- the new |
Spoke too soon. :-(
Any idea what's wrong? |
Why is it trying to build 1.22.0? This branch is at 1.22.1 (or 1.22.2 Pre) |
Both forward and back slashes are valid path separators on Windows, anything with a
PR.
No idea without knowing the exact operation(s) being performed. Is this trying to execute
That number is the Or:
The |
ebf3959
to
729f27b
Compare
New changes:
|
Pushed another change which will copy This is only for user convenience. Automated scripts should still get the files from |
Figured out that error. The Docker container relies on |
ckan.exe has always been the actual final executable after the ilrepack. |
The new build system introduces some minor changes: * New commands are required to build the software. * The binaries are stored in different places. The previous version of this Dockerfile was using the wrong binary! As a bonus, the configuration setting has been abstracted out as a build argument. To build CKAN in the Debug config, use this command: $ docker build --build-arg config=Debug -t ckan-debug . To use this container, a command line like this will be required: $ docker run --rm -v ${KSPDIR}:/kspdir ckan-debug install MechJeb The default configuration setting is Release.
Ah, TIL. I found the other one and it always worked for me! :-) Created that pull request #1988 -- let me know if there's anything else I can do. |
I've made some minor changes that make some problematic test fixtures more robust. As far as I can tell they should now be 100% reliable through the ReSharper and CLI test runners. This means you should be able to
Cool. |
- The mono version used is the latest (currently `4.6.2`) | ||
- A GitHub release is generated if the following conditions are met: | ||
- All previous steps were successful | ||
- The commit is tagged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you expand on this? Is this a tag we put on the GitHub PR when merging, a tag on the git commit, or a tag in CHANGES.md? I can't find anything that controls this in travis.yml (though I admit to not fully understanding the syntax)
It might be good to be able to create prereleases on GitHub as well as full releases. (Though we'd need to add an option in the client Auto-update code to opt-in to pre-releases) - I'm cool with adding this functionality later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a tag we put on the GitHub PR when merging, a tag on the git commit
These are the same thing. The actual mechanics of a release haven't changed. The only thing different is that the version number is now taken from CHANGES.md CHANGELOG.md rather than the tag itself. The tag can literally be anything so long as it exists. But for consistency it ought to match the version in CHANGES.md CHANGELOG.md.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be good to be able to create prereleases on GitHub as well as full releases.
Just tag a prerelease.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current method is to go to the releases page and create a new release there. So we still do that, but now the version number reported by the client will come from CHANGELOG.md. Ok, I get it. At some point I must grokify how that actually happens.
#1989 seems relevant to this, too. I'm not sure what we'd need to do to include this for Mac users. |
No idea, last time I used a Mac in earnest was before the turn of the millennium. |
Docker updates to support cake!
Docker works as expected. LGTM! |
Ooof! That was more of a headache than I expected. Must remember to merge upstream changes first! |
@pjf Cake (C# Make) is a build system that uses C# as its scripting language. This PR allows CKAN and NetKAN to be built using Cake.
On any system to build CKAN:
On any system to build NetKAN:
On any system to build both:
New
build.cake
this is the actual Cake build script. I wrote it to do pretty much whatbin/build
was doing. It performs the following operations:--target
: What task to execute, if not specified defaults toBuild
.--configuration
: The build configuration to use, if not specified defaults toDebug
.--solution
: The solution file to build, if not specified defaults toCKAN.sln
BuildDotNet
, this generatesMeta.cs
and runsDotNotBuild
which executesmsbuild
on Windows platforms andxbuild
on Unix-like platforms.BuildCkan
, this buildsckan.exe
BuildNetkan
, this buildsnetkan.exe
Build
, a wrapper tasks that does nothing itself but depends onBuildCkan
andBuildNetkan
.RunTarget(string)
IsStable()
andGetGitVersion()
build.ps1
andbuild
are shims to run Cake.build.ps1
is written in PowerShell for Windows systems andbuild
is written in POSIX-compliant shell script (not bash) for Unix-like systems. Both scripts are basically identical and perform the same general steps:packages.config
, a standard NuGet package configuration and is pasred by the shims)> ./build <target>
parse the arguments to make that possible.Debug
configuration for now until I can properly configure the existing projects.Differences
Meta.cs
in place, so instead I have aMeta.cs.in
template file which produces aMeta.cs
on build.Meta.cs
is then removed from source control and added to.gitignore
..build
top-level directory. The eventual goal is to get all build artifacts into this directory so that performing a clean build is a simplerm -r .build
and only one entry needs to be in our.gitignore
Makefile
,build.sh
, etc.).build/lib/nuget
directory and all project references have been fixed to refer to that directory. Anuget.config
file has also been added which will install packages in that directory by default. Yay for no more duplicate NuGet packages! (packages/
has also been removed from.gitignore
).lib/
for CurlSharp since it doesn't seem to have an official NuGet release. I want to eventually get away from CurlSharp anyway and consolidate all network code (working on that in another branch...)CKAN.sln
)..build/out
and the ILRepack'd executables are now directed to.build/repack
. The Travis CI configuration has been updated to reflect these changes.Debug
andRelease
configurations is now properly supported.Debug
is default, to build inRelease
use./build --configuration=Release
. Travis CI builds in both but only deploys inRelease
.assets
directoryMotivation
./build
in PowerShell.